{% extends 'layout.html' %}
{% load static %}

{% block content %}

    <div class="container">
        <div class="panel panel-default">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">{{ title }}</h3>
                </div>
                <div class="panel-body">
                    <form method="post" enctype="multipart/form-data" novalidate>
                        {% csrf_token %}
                        {% for item in uform %}
                            <div class="form-group">
                                <label> {{ item.label }}</label>
                                {{ item }}
                                <sapn style="color: red">{{ item.errors.0 }}</sapn>

                            </div>

                        {% endfor %}


                        <button type="submit" class="btn btn-primary">提 交</button>
                    </form>

                </div>
            </div>
        </div>


        <div class="panel panel-default">
            <!-- Default panel contents -->
            <div class="panel-heading">
                <span class="glyphicon glyphicon-th-list" aria-hidden="true"> </span>
                文件列表
            </div>
            <!-- Table -->
            <table class="table table-bordered">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>名称</th>
                    <th>年龄</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                {% for item in queryset %}
                    <tr style="text-align: center">
                        <th>{{ item.id }}</th>
                        <td>{{ item.name }}</td>
                        <td>{{ item.age }}</td>
                        <td>
                            <img style="height: 80px" src="/mdeia/{{ item.img }}">
                        </td>
                        <td>
                            {#                            <a class="btn btn-primary btn-xs" href="{% url 'depart_edit' %}">编辑</a>#}
                            <a class="btn btn-primary btn-xs">编辑</a>
                            <a class="btn btn-danger btn-xs">删除</a>
                        </td>
                    </tr>
                {% endfor %}

                </tbody>
            </table>


            <ul class="pagination">
                {{ page_string }}

                <li style="margin-left: 15px">

                    <form method="get" style="float: left;margin-left: -1px">
                        <div class="input-group" style="width: 100px">
                            <input type="text" name="page"
                                   style="position: relative;float: left;display: inline-block;width:100px;border-radius: 0"
                                   class="form-control" placeholder="页码">
                            <span class="input-group-btn">
                    <button style="border-radius: 0" class="btn btn-default" type="submit">跳转</button>
                </span>
                        </div>

                    </form>
                </li>
            </ul>
        </div>
    </div>

{% endblock %}

